<?php

 /**
  * CustContactLog Value Object.
  * This class is value object representing database table CustContactLog
  * This class is intented to be used together with associated Dao object.
  */

  
class CustContactLog {

    /** 
     * Persistent Instance variables. This data is directly 
     * mapped to the columns of database table.
     */
    var $CntctLogID;
    var $EmpID;
    var $CustID;
    var $ContactNotes;
    var $DateContacted;
    var $TicketID;

    public function getTicketID() {
        return $this->TicketID;
    }

    public function setTicketID($ticketID) {
        $this->TicketID = $ticketID;
    }

    

    /** 
     * Constructors.
     * The first one takes no arguments and provides the most simple
     * way to create object instance. The another one takes one
     * argument, which is the primary key of the corresponding table.
     */

    function CustContactLog () {

    }

    /* function CustContactLog ($CntctLogIDIn) {

          $this->CntctLogID = $CntctLogIDIn;

    } */


    /** 
     * Get- and Set-methods for persistent variables. The default
     * behaviour does not make any checks against malformed data,
     * so these might require some manual additions.
     */

    function getCntctLogID() {
          return $this->CntctLogID;
    }
    
    function setCntctLogID($CntctLogIDIn) {
          $this->CntctLogID = $CntctLogIDIn;
    }

    function getEmpID() {
          return $this->EmpID;
    }
    function setEmpID($EmpIDIn) {
          $this->EmpID = $EmpIDIn;
    }

    function getCustID() {
          return $this->CustID;
    }
    function setCustID($CustIDIn) {
          $this->CustID = $CustIDIn;
    }

    function getContactNotes() {
          return $this->ContactNotes;
    }
    function setContactNotes($ContactNotesIn) {
          $this->ContactNotes = $ContactNotesIn;
    }

    function getDateContacted() {
          return $this->DateContacted;
    }
    function setDateContacted($DateContactedIn) {
          $this->DateContacted = $DateContactedIn;
    }



    /** 
     * setAll allows to set all persistent variables in one method call.
     * This is useful, when all data is available and it is needed to 
     * set the initial state of this object. Note that this method will
     * directly modify instance variales, without going trough the 
     * individual set-methods.
     */

    function setAll($CntctLogIDIn,
          $EmpIDIn,
          $CustIDIn,
          $ContactNotesIn,
          $DateContactedIn) {
          $this->CntctLogID = $CntctLogIDIn;
          $this->EmpID = $EmpIDIn;
          $this->CustID = $CustIDIn;
          $this->ContactNotes = $ContactNotesIn;
          $this->DateContacted = $DateContactedIn;
    }


    /** 
     * hasEqualMapping-method will compare two CustContactLog instances
     * and return true if they contain same values in all persistent instance 
     * variables. If hasEqualMapping returns true, it does not mean the objects
     * are the same instance. However it does mean that in that moment, they 
     * are mapped to the same row in database.
     */
    function hasEqualMapping($valueObject) {

          if ($valueObject->getCntctLogID() != $this->CntctLogID) {
                    return(false);
          }
          if ($valueObject->getEmpID() != $this->EmpID) {
                    return(false);
          }
          if ($valueObject->getCustID() != $this->CustID) {
                    return(false);
          }
          if ($valueObject->getContactNotes() != $this->ContactNotes) {
                    return(false);
          }
          if ($valueObject->getDateContacted() != $this->DateContacted) {
                    return(false);
          }

          return true;
    }



    /**
     * toString will return String object representing the state of this 
     * valueObject. This is useful during application development, and 
     * possibly when application is writing object states in textlog.
     */
    function toString() {
        $out = $out."\nclass CustContactLog, mapping to table CustContactLog\n";
        $out = $out."Persistent attributes: \n"; 
        $out = $out."CntctLogID = ".$this->CntctLogID."\n"; 
        $out = $out."EmpID = ".$this->EmpID."\n"; 
        $out = $out."CustID = ".$this->CustID."\n"; 
        $out = $out."ContactNotes = ".$this->ContactNotes."\n"; 
        $out = $out."DateContacted = ".$this->DateContacted."\n"; 
        return $out;
    }


    /**
     * Clone will return identical deep copy of this valueObject.
     * Here, the retuned cloned object will also have all its attributes cloned.
     */
    function clone1() {
        $cloned = new CustContactLog();

        $cloned->setCntctLogID($this->CntctLogID); 
        $cloned->setEmpID($this->EmpID); 
        $cloned->setCustID($this->CustID); 
        $cloned->setContactNotes($this->ContactNotes); 
        $cloned->setDateContacted($this->DateContacted); 

        return $cloned;
    }


}

?>

